<template>
  <div class="shouyiview">
    <div class="shouyiview-card">
      <div class="shouyiview-carditem yinying" v-for="(item,index) of list" @click="xiangqingclick(item)" :key="index">
        <van-row offset="4" class="textaligncenter">
          <van-col span="18" style="padding-left:0.5rem">
              <div style="line-height:2rem" >
                  <div class="paddingzy shenglue">
                      {{item.incomeType == 1  ? `加油卡id：${item.gascardId}` : `银行账户：${item.incomeYhkh ? item.incomeYhkh : '暂无' }`}}
                  </div>
                  <div>
                      收益金额：{{item.incomePrice}}元
                  </div>
              </div>
          </van-col>
          <van-col class="textaligncenter-info2" span="6">{{item.incomeType | reincomeType}}</van-col>
        </van-row>
      </div>
    </div>
    <data-status :status="dataStatus"></data-status>
  </div>
</template>


<script>
import dataStatus from "../../../../components/commons/dataStatus";

export default {
  data() {
    return {
        dataStatus:'-1',
      list: null,
      liatquery: {
        pageNum: 1,
        pageSize: 10
      }
    };
  },
  components: { dataStatus },
  filters: {
    reincomeType(e) {
      switch (e) {
        case 1:
          return "油卡充值";
          break;
        case 2:
          return "油卡金额转账";
          break;
        case 3:
          return "套餐基础金额";
          break;
      }
    }
  },
  created() {
    this.getlist();
  },
  methods: {
    getlist() {
      this.$Api
        .get("/api/income/showMyIncome", this.liatquery)
        .then(res => {
          if (res.data.code == 200) {
            if (res.data.data.result == null) {
                  this.dataStatus = '0'
              }else{
                   this.list = res.data.data.result;
              }
          }else{
              this.dataStatus = '1'
          }
        })
        .catch(err => {});
    },
    xiangqingclick(e){
        this.$emit("xiangqing",e)
    }
  }
};
</script>


<style scoped>
.shouyiview {
}

.shouyiview-carditem {
  background-color: #ffffff;
  margin: 0.5rem 0;
}

.yinying {
	box-shadow: 0 0 20upx rgba(0, 0, 0, 0.3);
}

.paddingzy{
        padding-right: .3rem;
}

.shenglue{
    overflow: hidden;white-space: nowrap;text-overflow: ellipsis;
}

.shouyiview-carditem-info1 {
  flex: 5;
}

.shouyiview-carditem-info2 {
  flex: 1;
}

.textaligncenter {
  text-align: left;
 
  padding: 1rem 0;
}

.textaligncenter-info2{
    line-height: 4rem;
}
</style>